package compiler.semantic.type;

import java.util.ArrayList;
import java.util.List;

import es.uned.lsi.compiler.semantic.ScopeIF;
import es.uned.lsi.compiler.semantic.type.TypeBase;
import es.uned.lsi.compiler.semantic.type.TypeIF;

/**
 * Class for TypeProcedure.
 */

// TODO: Student work
//       Include properties to characterize procedure declarations

public class TypeProcedure
    extends TypeBase
{   
	
	public class Parametro {
		public String nombre;
		public TypeIF tipo;
		public Parametro(String nombre, TypeIF tipo) {
			this.nombre = nombre;
			this.tipo = tipo;
		}
		@Override
		public String toString() {
			return "Parametro [nombre=" + nombre + ", tipo=" + tipo.getName() + "]";
		}
		
	}
	
	protected String nombre;
	protected List<Parametro> parametros = new ArrayList<TypeProcedure.Parametro>();
   /**
     * Constructor for TypeProcedure.
     * @param scope The declaration scope.
     */
    public TypeProcedure (ScopeIF scope)
    {
        super (scope);
    }

    /**
     * Constructor for TypeProcedure.
     * @param scope The declaration scope
     * @param name The name of the procedure.
     */
    public TypeProcedure (ScopeIF scope, String name)
    {
        super (scope, name);
    }
    
    /**
     * Returns the size of the type.
     * @return the size of the type.
     */
    @Override
    public int getSize ()
    {
        // TODO: Student work
        return 1;
    }
    
    public void addParametro(String nombre, TypeIF tipo){
    	parametros.add(new Parametro(nombre, tipo));
    	System.out.println(parametros);
    }
}
